package ml.practicum.learn;

import java.io.Serializable;
import java.util.List;
/**
 * This is a an interface for a perceptron model
 * it extends the gereral model of a classifying system
 * @author Joscha
 *
 * @param <T> type of value to use for the perceptron inputs and outputs
 */
public interface Perceptron<T extends Number> extends Serializable, Model<T>  {
	/**
	 * set the bias of the model this is a "weight" without an input
	 * @param weight
	 */
	void setBias(double weight);
	/**
	 * get the bias, the weight without an input 
	 * @return the bias of the model
	 */
	double getBias();
	
	/**
	 * set the weights to the double values in a list
	 * @param weight the list with weights
	 */
	void setWeights(List<Double> weight); 
	
	/**
	 * get list of weights by reference
	 * @return the list of weights
	 */
	List<Double> getWeights();
	
	/**
	 * resets the perceptron to random weights and bias with in a range
	 * <p>can also be used to change the perceptron size
	 * </p>
	 * @param min the minimum of the range
	 * @param max the maximum of the allowed range
	 * @param nrWeigths the number of weights to set the perceptron size
	 */
	void randomize(double min, double max, int nrWeigths);
	
	/**
	 * change or set the activation function used by the perceptron to calculate the output
	 * @param input the activation function to use
	 */
	void setActivationFunction(ActivationFunction<T> input);
	
	/**
	 * get back the activation function currently used by the perceptron
	 * @return the activation function used
	 */
	ActivationFunction<T> getActivationFunction();
}
